-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add file flush in sys_close and sys_exit #80
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please fix bugs and some code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are concurrency bugs for the sys_exit
and sys_pthread_exit
:
Checking fd_table_count()
in every while
loop seems to be unsafe for multi-thread situation..... I'll take more consideration..... @ken4647
By the way, ramfs
should implement a fake flush
as well.
@@ -184,7 +192,7 @@ fn flags_to_options(flags: c_int, _mode: ctypes::mode_t) -> OpenOptions { | |||
/// has the maximum number of files open. | |||
pub fn sys_open(filename: *const c_char, flags: c_int, mode: ctypes::mode_t) -> c_int { | |||
let filename = char_ptr_to_str(filename); | |||
debug!("sys_open <= {:?} {:#o} {:#o}", filename, flags, mode); | |||
info!("sys_open <= {:?} {:#o} {:#o}", filename, flags, mode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use debug
@@ -196,7 +204,7 @@ pub fn sys_open(filename: *const c_char, flags: c_int, mode: ctypes::mode_t) -> | |||
pub fn sys_openat(fd: usize, path: *const c_char, flags: c_int, mode: ctypes::mode_t) -> c_int { | |||
let path = char_ptr_to_str(path); | |||
let fd: c_int = fd as c_int; | |||
debug!("sys_openat <= {}, {:?}, {:#o} {:#o}", fd, path, flags, mode); | |||
info!("sys_openat <= {}, {:?}, {:#o} {:#o}", fd, path, flags, mode); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use debug
@@ -8,6 +8,7 @@ | |||
*/ | |||
|
|||
use alloc::sync::Arc; | |||
use axio::Error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unused?
For example:
|
|
I think this PR should be merged after #81 is fixed. |
In |
No description provided.